package top.college.screen;

import javax.swing.table.DefaultTableModel;

import top.college.model.AdminVO;
import top.college.model.ProfessorVO;
import top.college.service.AdminRead;
import top.college.service.ProfessorRead;

public class ProfessorSelectTable {

	public static DefaultTableModel professorSelectTable() {
		final DefaultTableModel dtm = new DefaultTableModel() {
			@Override
			public boolean isCellEditable(int row, int column) {
				return false;
			}
		};
		
		String title[] = { "순번", "교수번호", "이름", "담당학과", "연락처","사무실", "주소", "등록일자" };
		dtm.setColumnIdentifiers(title);
		
		int count = 1;
		for(ProfessorVO pv : ProfessorRead.readProfessor() ){
			pv.getProf_no();
			dtm.addRow( new String[] { Integer.toString(count), pv.getProf_no(), pv.getProf_name(),
					pv.getDept_no(), pv.Prof_tel(), pv.Prof_office(), pv.Prof_addr(), pv.getReg_date() });
			++ count;
		}
		return dtm;
	}
		
		
	}
	
}
